HA$PBExportHeader$w_arg_rep_resumen_ventas.srw
forward
global type w_arg_rep_resumen_ventas from w_arg_report
end type
type st_1 from statictext within w_arg_rep_resumen_ventas
end type
type st_2 from statictext within w_arg_rep_resumen_ventas
end type
type dp_fini from datepicker within w_arg_rep_resumen_ventas
end type
type st_3 from statictext within w_arg_rep_resumen_ventas
end type
type st_4 from statictext within w_arg_rep_resumen_ventas
end type
type dp_ffin from datepicker within w_arg_rep_resumen_ventas
end type
type ddlb_cliente from uo_middlb within w_arg_rep_resumen_ventas
end type
type ddlb_cond from uo_middlb within w_arg_rep_resumen_ventas
end type
type st_5 from statictext within w_arg_rep_resumen_ventas
end type
type ddlb_tdocu from uo_middlb within w_arg_rep_resumen_ventas
end type
type st_6 from statictext within w_arg_rep_resumen_ventas
end type
type ddlb_alma from uo_middlb within w_arg_rep_resumen_ventas
end type
end forward

global type w_arg_rep_resumen_ventas from w_arg_report
integer width = 2267
integer height = 1068
string title = "Reporte Resumen de Ventas"
st_1 st_1
st_2 st_2
dp_fini dp_fini
st_3 st_3
st_4 st_4
dp_ffin dp_ffin
ddlb_cliente ddlb_cliente
ddlb_cond ddlb_cond
st_5 st_5
ddlb_tdocu ddlb_tdocu
st_6 st_6
ddlb_alma ddlb_alma
end type
global w_arg_rep_resumen_ventas w_arg_rep_resumen_ventas

type variables

string isa_clie[],is_clie,isa_cond[],is_cond,is_tdocu ,isa_tdocu[],is_alma,isa_alma[]

end variables

forward prototypes
public subroutine wf_ejecutar_reporte ()
end prototypes

public subroutine wf_ejecutar_reporte ();Datetime ldt_fecini,ldt_fecfin
string ls_titulo_fecha
ldt_fecini =datetime(date(dp_fini.text),time('00:00:00'))
ldt_fecfin = datetime(date(dp_ffin.text),time('23:59:59'))
ls_titulo_fecha = 'DESDE ' + STRING(ldt_fecini,'DD/MM/YYYY') + ' AL ' + STRING(ldt_fecfin,'DD/MM/YYYY HH:MM:SS')

istr_parm.dw_parm[1].Retrieve(istr_parm.integer_parm[1],istr_parm.integer_parm[2],istr_parm.integer_parm[3],ldt_fecini,ldt_fecfin,istr_parm.integer_parm[4])
istr_parm.dw_parm[1].object.titulo.text = 'RESUMEN DE VENTA - ALMACEN: ' + upper(ddlb_alma.text)
istr_parm.dw_parm[1].object.t_fecha.text = ls_titulo_fecha
end subroutine

on w_arg_rep_resumen_ventas.create
int iCurrent
call super::create
this.st_1=create st_1
this.st_2=create st_2
this.dp_fini=create dp_fini
this.st_3=create st_3
this.st_4=create st_4
this.dp_ffin=create dp_ffin
this.ddlb_cliente=create ddlb_cliente
this.ddlb_cond=create ddlb_cond
this.st_5=create st_5
this.ddlb_tdocu=create ddlb_tdocu
this.st_6=create st_6
this.ddlb_alma=create ddlb_alma
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.st_1
this.Control[iCurrent+2]=this.st_2
this.Control[iCurrent+3]=this.dp_fini
this.Control[iCurrent+4]=this.st_3
this.Control[iCurrent+5]=this.st_4
this.Control[iCurrent+6]=this.dp_ffin
this.Control[iCurrent+7]=this.ddlb_cliente
this.Control[iCurrent+8]=this.ddlb_cond
this.Control[iCurrent+9]=this.st_5
this.Control[iCurrent+10]=this.ddlb_tdocu
this.Control[iCurrent+11]=this.st_6
this.Control[iCurrent+12]=this.ddlb_alma
end on

on w_arg_rep_resumen_ventas.destroy
call super::destroy
destroy(this.st_1)
destroy(this.st_2)
destroy(this.dp_fini)
destroy(this.st_3)
destroy(this.st_4)
destroy(this.dp_ffin)
destroy(this.ddlb_cliente)
destroy(this.ddlb_cond)
destroy(this.st_5)
destroy(this.ddlb_tdocu)
destroy(this.st_6)
destroy(this.ddlb_alma)
end on

event open;call super::open;istr_parm.integer_parm[1]=0
istr_parm.integer_parm[2]=0
istr_parm.integer_parm[3]=0
istr_parm.integer_parm[4]=0

ddlb_cliente.selectitem(1)
ddlb_cond.selectitem(1)
ddlb_tdocu.selectitem(1)
ddlb_alma.selectitem(1)
end event

type cb_2 from w_arg_report`cb_2 within w_arg_rep_resumen_ventas
integer x = 1774
integer y = 836
end type

type cb_1 from w_arg_report`cb_1 within w_arg_rep_resumen_ventas
integer x = 1339
integer y = 836
end type

type dw_1 from w_arg_report`dw_1 within w_arg_rep_resumen_ventas
boolean visible = false
integer x = 59
integer y = 820
integer width = 366
integer height = 372
end type

type st_1 from statictext within w_arg_rep_resumen_ventas
integer x = 46
integer y = 196
integer width = 329
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Cliente:"
boolean focusrectangle = false
end type

type st_2 from statictext within w_arg_rep_resumen_ventas
integer x = 37
integer y = 432
integer width = 329
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Condicion:"
boolean focusrectangle = false
end type

type dp_fini from datepicker within w_arg_rep_resumen_ventas
integer x = 471
integer y = 556
integer width = 594
integer height = 84
integer taborder = 50
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2011-03-15"), Time("09:44:20.000000"))
integer textsize = -8
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type st_3 from statictext within w_arg_rep_resumen_ventas
integer x = 41
integer y = 556
integer width = 379
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Inicial:"
boolean focusrectangle = false
end type

type st_4 from statictext within w_arg_rep_resumen_ventas
integer x = 41
integer y = 688
integer width = 334
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Final:"
boolean focusrectangle = false
end type

type dp_ffin from datepicker within w_arg_rep_resumen_ventas
integer x = 471
integer y = 680
integer width = 585
integer height = 84
integer taborder = 40
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2011-03-15"), Time("09:44:20.000000"))
integer textsize = -8
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type ddlb_cliente from uo_middlb within w_arg_rep_resumen_ventas
integer x = 475
integer y = 176
integer width = 1646
integer height = 600
boolean bringtotop = true
end type

event constructor;call super::constructor;this.event ue_rellena('select idclie,trazonsocial from mcliente order by 2 asc')
end event

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[1]=integer(isa_clie[index] )

//ddlb_item.reset( )
//ddlb_item.event ue_rellena('select a.iditem,i.tDescCorta from mitem i , mitemalma a where i.iditem = a.iditem and  a.idalma ="'+string(istr_parm.integer_parm[1])+'" order by 1 asc')
end event

event ue_rellena;long ll_indice= 1
string ls_campo[]

setpointer(hourglass!)
isa_clie[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_clie[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_clie[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

type ddlb_cond from uo_middlb within w_arg_rep_resumen_ventas
integer x = 475
integer y = 416
integer width = 869
integer height = 600
integer taborder = 20
boolean bringtotop = true
end type

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[2]=integer(isa_cond[index] )
end event

event ue_rellena;long ll_indice= 1
setpointer(hourglass!)

string ls_campo[]

isa_cond[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++


prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_cond[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_cond[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

event constructor;call super::constructor;this.event ue_rellena('select idcond,tdesc from MCONDVTA order by 1 asc')
end event

type st_5 from statictext within w_arg_rep_resumen_ventas
integer x = 32
integer y = 304
integer width = 448
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Tipo Documento:"
boolean focusrectangle = false
end type

type ddlb_tdocu from uo_middlb within w_arg_rep_resumen_ventas
integer x = 475
integer y = 296
integer width = 878
integer height = 600
integer taborder = 20
boolean bringtotop = true
end type

event constructor;call super::constructor;this.event ue_rellena('select iddocu,tdesc from MTIPODOCU order by 1 asc')
end event

event ue_rellena;long ll_indice= 1
string ls_campo[]

setpointer(hourglass!)
isa_tdocu[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_tdocu[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_tdocu[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)


end event

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[3]=integer(isa_tdocu[index] )

end event

type st_6 from statictext within w_arg_rep_resumen_ventas
integer x = 41
integer y = 56
integer width = 329
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Almacen:"
boolean focusrectangle = false
end type

type ddlb_alma from uo_middlb within w_arg_rep_resumen_ventas
integer x = 471
integer y = 40
integer width = 1646
integer height = 600
integer taborder = 20
boolean bringtotop = true
end type

event constructor;call super::constructor;this.event ue_rellena('select idalma,tdesc from malmacen order by 1 asc')
end event

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[4]=integer(isa_alma[index] )
end event

event ue_rellena;long ll_indice= 1
string ls_campo[]

setpointer(hourglass!)
isa_alma[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_alma[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_alma[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

